package com.car.serve.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.car.serve.entity.ServeModifyLog;
import com.car.serve.form.PageServeModifyLogForm;
import com.car.serve.mapper.ServeModifyLogMapper;
import com.car.serve.service.ServeModifyLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 董旭
 * @since 2024-08-28
 */
@Service
public class ServeModifyLogServiceImpl extends ServiceImpl<ServeModifyLogMapper, ServeModifyLog> implements ServeModifyLogService {
    @Resource
    private ServeModifyLogMapper serveModifyLogMapper;
    @Override
    public Page<ServeModifyLog> findServeModifyLogPage(PageServeModifyLogForm form) {
        Page<ServeModifyLog> page = new Page<>(form.getPageNum()==null?1:form.getPageNum(),form.getPageSize()==null?6:form.getPageSize());
        QueryWrapper<ServeModifyLog> wrapper = new QueryWrapper<>();
        wrapper.orderByDesc("modify_time");
        Page<ServeModifyLog> serveModifyLogPage = serveModifyLogMapper.selectPage(page, wrapper);
        return serveModifyLogPage;
    }
}
